package allwe.thread04;

public class TestDaemon extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("child ======== " + i);
        }
    }
}

class Test{
    public static void main(String[] args) {
        TestDaemon testDaemon = new TestDaemon();
        testDaemon.setDaemon(true);
        testDaemon.start();


        for (int i = 0; i < 10; i++) {
            System.out.println("main=" + i);
            if (i == 5)
                Thread.currentThread().stop();
        }
    }
}
